<?php

namespace app\adminapi\validate;


use app\common\validate\BaseValidate;


/**
 * Device验证器
 * Class DeviceValidate
 * @package app\adminapi\validate
 */
class DeviceValidate extends BaseValidate
{

    /**
     * 设置校验规则
     * @var string[]
     */
    protected $rule = [
        'id' => 'require',
        'cid' => 'require',
        'name' => 'require',
        'device_no' => 'require',
        'type' => 'require',
    ];


    /**
     * 参数描述
     * @var string[]
     */
    protected $field = [
        'id' => 'id',
        'cid' => '院区',
        'name' => '名称',
        'device_no' => '设备编号',
        'type' => '类型：1=水表，2=电表',

    ];


    /**
     * @notes 添加场景
     * @return DeviceValidate
     * @author likeadmin
     * @date 2024/02/28 15:43
     */
    public function sceneAdd()
    {
        return $this->only(['cid', 'name','device_no', 'type']);
    }


    /**
     * @notes 编辑场景
     * @return DeviceValidate
     * @author likeadmin
     * @date 2024/02/28 15:43
     */
    public function sceneEdit()
    {
        return $this->only(['id', 'cid','name', 'device_no', 'type']);
    }


    /**
     * @notes 删除场景
     * @return DeviceValidate
     * @author likeadmin
     * @date 2024/02/28 15:43
     */
    public function sceneDelete()
    {
        return $this->only(['id']);
    }


    /**
     * @notes 详情场景
     * @return DeviceValidate
     * @author likeadmin
     * @date 2024/02/28 15:43
     */
    public function sceneDetail()
    {
        return $this->only(['id']);
    }
}
